import request from '@/utils/request.js';

// 查询宠物详情
export function fetchShelfDetail(petId) {
  return request({
    url: `/core/shelf/record/${petId}`,
    method: 'get',
    headers: {
      isAuth: false,
    },
  });
}
//点赞
export function sendLike(data) {
  return request({
    url: '/core/pet/social/thumb/up',
    method: 'post',
    data,
  });
}

// 取消点赞
export function sendCancelLike(data) {
  return request({
    url: '/core/pet/social/cancel/thumb',
    method: 'post',
    data,
  });
}
//根据宠物id修改已读标识
export function updateDiaryRead(petId) {
  return request({
    url: `/core/cloud/adopt/diary/read/${petId}`,
    method: 'put',
  });
}
//查看爱心榜-全部捐助记录
export function selectLoveList(params) {
  return request(({
    url: '/shop-core/donate/page/pet_shelf',
    method: 'get',
    params,
  }));
}
//查看爱心榜
export function selectLoveById(petId) {
  return request(({
    url: `/shop-core/donate/list/love/${petId}`,
    method: 'get',
  }));
}
//查看认养守护日记
export function selectAdoptDiary(params) {
  return request({
    url: '/core/cloud/adopt/diary/page/customer',
    method: 'get',
    params,
  });
}
//查看是否点赞
export function selectSocialContent(params) {
  return request({
    url: '/core/pet/social/content/shortcut',
    method: 'get',
    params,
  });
}
// 获取宠物的最新爱心投喂前50记录（轮播）
export function donateListMsg(petId) {
  return request({
    url: `/shop-core/donate/list/latest_love/${petId}`,
    method: 'get',
  });
}